﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;
using DataLib.Common;
using System.Drawing;
using DataLib.Accounts.Bus;

namespace Ewts.BaseData
{
    public partial class VehiclorList : System.Web.UI.Page
    {



        DataLib.BLL.Vehiclor bll = new DataLib.BLL.Vehiclor();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindData();
            }
        }

        protected void BindData()
        {
            
            DataTable dt = new DataLib.BLL.Vehiclor().GetList("").Tables[0];
            reptVehiclor.DataSource = dt;
            reptVehiclor.DataBind();

        }

        protected void reptVehiclor_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int id=Convert.ToInt32(e.CommandArgument.ToString());
            //Response.Write(id);
            bool del = new DataLib.BLL.Vehiclor().Delete(id);
            if (del == true)
            {

                DataTable dt = new DataLib.BLL.Vehiclor().GetList("isdel=0 ").Tables[0];
                reptVehiclor.DataSource = dt;
                reptVehiclor.DataBind();
            }
            else
            {
               
                return;
            }
        }


    }
}
